/*
    @File:      Prova_AM.c    
    @Author:    Tomás González Sánchez
    @Date:      25/10/06
    @e-address: gonzalezt@gmail.com
*/

#include <stdlib.h>
#include <stdio.h>

#include "Access_Motion.h"
#include <string.h>


int main()
{
    int pos; 
    int error;
    char nom[LENG_NAME];

    strcpy(nom,"/dev/video0");
   pos = AM_Set_NewCam(nom,2,320,240,TRUE,"/home/gonho/Desktop/prova",60,60,1500,"script_start","script_end");
    printf("Posicio d'insercio: %i\n",pos);
    strcpy(nom,"/dev/video1");
  pos = AM_Set_NewCam(nom,2,320,240,FALSE,"/home/gonho/Desktop/prova",60,60,1500,"script_start","script_end");
    printf("Posicio d'insercio: %i\n",pos);
    pos = AM_Get_NumCams();
    printf("Numero de camers insertades: %i\n",pos);

    AM_Set_FrameRatePos(1,23);
    AM_Set_FrameRate("/dev/video0",30);
    printf("Canvi frame rate pos 2 (no existeix): %i\n",AM_Set_FrameRatePos(2,23));
    printf("Canvi frame rate dev 2 (no existeix): %i\n",AM_Set_FrameRate("/dev/video2",30));

    printf("Frame rate camera 0: %i\n",AM_Get_FrameRate("/dev/video0"));
    printf("Frame rate camera 1: %i\n",AM_Get_FrameRate("/dev/video1"));
    printf("Frame rate camera 2(no existeix): %i\n",AM_Get_FrameRate("/dev/video2"));


    printf("Frame rate camera pos 0: %i\n",AM_Get_FrameRatePos(0));
    printf("Frame rate camera pos 1: %i\n",AM_Get_FrameRatePos(1));
    printf("Frame rate camera pos 2 (no existeix): %i\n",AM_Get_FrameRatePos(2));


    printf("Creacio fitxer de sortida p_motion.conf\n");
    //AM_Create_MotionFilePos("p_motion.conf",1);
    AM_Create_MotionFile("p_tercera_motion.conf","/dev/video0");

    return(0);
}
